<style>
</style>
<template>
    <ly-page>
        <ly-navi title="提示"></ly-navi>
        <ly-page-content>
            <div style="height: 20px"></div>
            <div style="margin-bottom: 20px; color: #3793FF;">默认</div>
            <div>
                <el-button @click="showMessage('info')">info</el-button>
                <el-button @click="showMessage('success')">success</el-button>
                <el-button @click="showMessage('warning')">warning</el-button>
                <el-button @click="showMessage('error')">error</el-button>

            </div>
            <div style="height: 20px"></div>
            <div style="margin-bottom: 20px; color: #3793FF;">手动关闭</div>
            <div>
                <el-button @click="showMessage('info',true)">info</el-button>
                <el-button @click="showMessage('success',true)">success</el-button>
                <el-button @click="showMessage('warning',true)">warning</el-button>
                <el-button @click="showMessage('error',true)">error</el-button>

            </div>
            <ly-code-view>
                <pre v-pre>
if (showClose) {
    this.$message({message: '这是一条消息提示', type: type, showClose: true, duration: 0});
} else {
    this.$message({message: '这是一条消息提示', type: type});
}
                </pre>
            </ly-code-view>

        </ly-page-content>
    </ly-page>
</template>
<script>
    Rap.define("", [], function () {
        return {
            data: function () {
                return {
                    step: 1
                }
            },
            mounted: function () {

            },
            methods: {
                showMessage: function (type, showClose) {
                    if (showClose) {
                        this.$message({message: '这是一条消息提示', type: type, showClose: true, duration: 0});
                    } else {
                        this.$message({message: '这是一条消息提示', type: type});
                    }

                }
            }
        }
    })
</script>